#include<stdio.h>
#include<stdlib.h>
#define MAX_SIZE 1000

/*键值对 int->string*/
typedef struct 
{
    int key;
    char *val;    
}Pair;
/*基于数组实现的哈希表*/
typedef struct 
{
    Pair *buckets[MAX_SIZE];
}ArrayHashMap;
/*构造函数*/
ArrayHashMap *newArrayHashMap()
{
    ArrayHashMap *hmap = (ArrayHashMap *)malloc(sizeof(ArrayHashMap));
    for (int i = 0; i < MAX_SIZE; i++)
    {
        hmap->buckets[i] = NULL;
    }
    return hmap;
}
/*析构函数*/
void delArrayHashMap(ArrayHashMap *hmap)
{
    for (int i = 0; i < MAX_SIZE; i++)
    {
        if (hmap->buckets[i] != NULL)
        {
            free(hmap->buckets[i]->val);
            free(hmap->buckets[i]);
        }
    }
    free(hmap);
}
/*添加键值对*/
void put(ArrayHashMap *hmap, int key, char *val)
{
    Pair *pair = (Pair *)malloc(sizeof(Pair));
    pair->key = key;
    pair->val = val;
    hmap->buckets[key] = pair;
}
int main(int argc, char const *argv[])
{
    
}
